﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepCultivation.API.AddliCation.SheepFarmsetup;
using SheepCultivation.Common.Domain.SheepFarmSetting;
using SheepCultivation.Common.Dto;
using SheepCultivation.Enum;

namespace SheepCultivation.API.Controllers
{
    /// <summary>
    /// 羊场设置控制器
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class SheepFarmController : ControllerBase
    {
        public readonly IMediator mediator;

        public SheepFarmController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 羊场设置表新增
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepFarmAdd")]
        public async Task<Result> Handle(SheepFarmsetupCreateCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 羊场设置列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SheepFarmlist")]
        public async Task<Result> Handle(SheepFarmSeachCommon request)
        {
            return await mediator.Send(request);
        }
    }
}
